<template>
  <div>
    <div class="login-head">
      <span style="color: #fff" @click="jumpFn()">
        <van-icon name="arrow-left"
      /></span>
      <span class="login-title">修改用户名</span>
      <span></span>
    </div>
    <div style="text-align: center">
      <el-input
        v-model="input"
        placeholder="请输入内容"
        maxlength="24"
        minlength="5"
        class="newuser"
      ></el-input>
    </div>
    <p>用户名只能修改一次(5-24字符之间)</p>
    <div style="text-align: center">
      <van-button type="info" class="qrxg" @click="modifyNew()">确认修改</van-button>
    </div>
  </div>
</template>

<script>
export default {
  name: "userV",

  data() {
    return {
      input: "",
    };
  },
  mounted() {},
  methods: {
    jumpFn() {
      this.$router.back();
    },
    modifyNew() {
      this.$store.commit("modifyUserName", this.input);
      alert("修改成功")
    },
  },
};
</script>

<style scoped>
.login-head {
  width: 100%;
  height: 1.2576rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #0092e8;
  position: fixed;
  top: 0;
  left: 0;
}
.login-title {
  color: white;
  position: relative;
  left: -0.5405rem;
  font-size: 0.5405rem;
}
p {
  font-size: 14px;
  color: #ea3106;
  padding-top: 10px;
  margin-left: 9px;
}
.qrxg {
  width: 95%;
  margin-top: 30px;
}
.newuser {
  margin-top: 55px;
  width: 95%;
}
</style>